package com.xrit.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xrit.mapper.UserMapper;
import com.xrit.pojo.User;
import com.xrit.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


@Service
@ContextConfiguration({"classpath:beans-service.xml"})
@RunWith(SpringJUnit4ClassRunner.class)
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User findByName(String name) {
        return userMapper.findByName(name);
    }

    @Test
    public void test(){
        User admin = findByName("admin");
        System.out.println(admin);
    }
}
